//
//  NSString+Python.h
//
//
//  Created by caoyuan on 5/24/16.
//  Copyright © 2016 baidu. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (Python)
/**
 *  字符串拼接
 *  str2 = str2.add(@"aaa").append(@"bbbb");
 *  @return 拼接完的字符串
 */
- (NSString* (^)(NSString *))pyAppend;
/**
 *  str2 = str2.find(@"aaa")
 *
 *  @return return NSInteger poistion, else return -1
 */
- (NSInteger (^)(NSString *subStr))pyFind;
/**
 *  替换str中的oldstr为newStr
 *  str2 = str2.replace(@"good",@"xxxx").replace(@"xnice",@"HHHH").replace(nil,nil);
 *  @return 替换完的str
 */
- (NSString* (^)(NSString *, NSString *))pyReplace;
/**
 *  返回子串，from begin to end ，begin从0开始，end到[str lenght]
 *  str = str.pyRange(0,5)
 *  @return 子串
 */
- (NSString* (^)(NSInteger , NSInteger ))pyRange;
/**
 *  string 翻转，str = str.pyReverse();
 */
- (NSString *(^)(void))pyReverse;
@end
